﻿<UserControl xmlns:chartingToolkit="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"  
    x:Class="ODAF.SilverlightApp.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:m="clr-namespace:Microsoft.Maps.MapControl;assembly=Microsoft.Maps.MapControl"
    xmlns:mCore="clr-namespace:Microsoft.Maps.MapControl.Core;assembly=Microsoft.Maps.MapControl"
    xmlns:local="clr-namespace:ODAF.SilverlightApp"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
    xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:uc="local.UserControls"
    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">
  
    
   

    <Grid x:Name="LayoutRoot" Height="Auto">
        
        <Grid.Background>

            <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                <GradientStop Color="#585958" Offset="1.0"></GradientStop>
                <GradientStop Color="#000000" Offset="0.81"></GradientStop>
                <GradientStop Color="#41225F " Offset="0.0"></GradientStop>
            </LinearGradientBrush>
        </Grid.Background>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="240" MinWidth="200"/>
            <ColumnDefinition MinWidth="400"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="49"></RowDefinition>
            <RowDefinition></RowDefinition>

        </Grid.RowDefinitions>

        <Path Stretch="Fill" Height="49" Grid.Row="0" Grid.ColumnSpan="2" Canvas.Left="0" Canvas.Top="0" Data="M0.5,49.5L1023.499,49.5L1023.499,0.5L0.5,0.5z">
            <Path.Fill>
                <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                    <GradientStop Color="#FF40215E" Offset="0"/>
                    <GradientStop Color="sc#1, 0.237268567, 0.128744826, 0.307409465" Offset="0.26262680694580076"/>
                    <GradientStop Color="#FFAE87BC" Offset="0.80368000268936157"/>
                    <GradientStop Color="#FFAE87BC" Offset="1"/>
                </LinearGradientBrush>
            </Path.Fill>
        </Path>

        
        <Grid  Grid.Row="0" Grid.ColumnSpan="2" Height="49">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="240"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="200"/>
            </Grid.ColumnDefinitions>
            
            <Image Grid.Column="0" Source="Images/Logo.png" Stretch="None" VerticalAlignment="Center" Margin="2,2,2,4" MouseLeftButtonUp="Image_MouseLeftButtonUp"/>

            <TextBlock x:Name="tbPageURL" Grid.Column="1"
                       Foreground="White" FontFamily="Segoe UI"
                       HorizontalAlignment="Left" 
                       VerticalAlignment="Center"
                       FontSize="14"
                       Text="A Social Map of Vancouver Open Data" 
                       Margin="8"/>

            <local:TwitterUserBadge x:Name="currentUserBadge"  
                                    Grid.Column="2"
                                    HorizontalAlignment="Right"
                                    VerticalAlignment="Top"
                                    BorderBrush="WhiteSmoke" 
                                    BorderThickness="1"
                                    Margin="2" >


            </local:TwitterUserBadge>
        </Grid>
        
        <StackPanel Grid.Row="1" Width="240" Margin="1">
            <!-- Spacer -->
            <!--<Canvas Height="20" Background="Transparent">
                
            </Canvas>-->
            
          
            <Canvas Height="32">
                <Path Stretch="Fill" Data="M1.5,98.5L328.5,98.5L328.5,79.5L1.5,79.5z" UseLayoutRounding="False">
                    <Path.Fill>
                        <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                            <GradientStop Color="#FF57585A" Offset="0"/>
                            <GradientStop Color="#FF221E1F" Offset="1"/>
                        </LinearGradientBrush>
                    </Path.Fill>
                </Path>

                <TextBlock Foreground="White" Text="LANDMARKS" Margin="4"/>
            </Canvas>

            <ItemsControl x:Name="lbPointFeeds" 
                     Margin="0" Padding="0"
                     Background="Transparent" 
                     BorderThickness="0">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <CheckBox Height="25" Width="230" 
                                  Click="cb1_Click" 
                                  VerticalContentAlignment="Center" 
                                  Style="{StaticResource PointFeedCheckBox}"/>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
            <!-- Spacer -->
            <Canvas Background="Transparent" Height="20"/>


            

            <StackPanel x:Name="socialStackPanel">
            <Canvas Height="32">
                <Path Stretch="UniformToFill"  Data="M1.5,98.5L328.5,98.5L328.5,79.5L1.5,79.5z" UseLayoutRounding="False">
                    <Path.Fill>
                        <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                            <GradientStop Color="#FF57585A" Offset="0"/>
                            <GradientStop Color="#FF221E1F" Offset="1"/>
                        </LinearGradientBrush>
                    </Path.Fill>
                </Path>
                <TextBlock Foreground="White" Text="SOCIAL LANDMARKS" Margin="4"></TextBlock>
            </Canvas>

            <ItemsControl x:Name="lbSocialFeeds" 
                     Margin="0" Padding="0"
                     Background="Transparent"
                     BorderThickness="0">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <CheckBox Height="25" Width="230" 
                                  Click="cbSocialFeedClick" 
                                  VerticalContentAlignment="Center" 
                                  Loaded="CheckBox_Loaded" 
                                  Style="{StaticResource PointFeedCheckBox}"/>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
                
            </StackPanel>


            <!--<Canvas Height="200" Width="240">
                <Border BorderThickness="5" BorderBrush="Black" >
                    <m:Map x:Name="MiniMap" 
                        Height="200" Width="240"
                        Mode="Road" 
                        NavigationVisibility="Collapsed" 
                        ScaleVisibility="Collapsed" 
                        LogoVisibility="Collapsed"
                        CopyrightVisibility="Collapsed"
                        CredentialsProvider="{StaticResource MyCredentials}">
                        <Rectangle Canvas.Left="125" Canvas.Top="85" Stroke="Black" Opacity="0.5" StrokeThickness="1" StrokeDashArray="2" />
                    </m:Map>
                </Border>
                
          </Canvas>-->


            <!--<local:TwitterUserBadge x:Name="currentUserBadge">
                
                
            </local:TwitterUserBadge>-->

                <Button x:Name="btnAddLandmark" 
                  Width="150" 
                  Visibility="Collapsed"
                  VerticalAlignment="Bottom" 
                  Margin="20"
                  HorizontalAlignment="Center"  
                  Style="{StaticResource DefaultButton}" 
                  Click="AddLandmark_Click"
                  Content="+ Add a Landmark"/>
 





            <!--<Slider x:Name="xRotSlider" 
                Orientation="Vertical" 
                Height="128" 
                Width="32" 
                Minimum="-30" Maximum="30" 
                Value="{Binding ElementName=projRotX, Path=RotationX, Mode=TwoWay}"/>-->
            
            <!-- Spacer -->
            <Canvas Background="Transparent" Height="20"/>

            <Canvas Height="32">
                <Path Stretch="UniformToFill"  Data="M1.5,98.5L328.5,98.5L328.5,79.5L1.5,79.5z" UseLayoutRounding="False">
                    <Path.Fill>
                        <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                            <GradientStop Color="#FF57585A" Offset="0"/>
                            <GradientStop Color="#FF221E1F" Offset="1"/>
                        </LinearGradientBrush>
                    </Path.Fill>
                </Path>
                <TextBlock Foreground="White" Text="MAP ATTRIBUTES" Margin="4"></TextBlock>
            </Canvas>

            <ItemsControl x:Name="lbRegionFeeds" 
                     Margin="0" Padding="0"
                     Background="Transparent"
                     BorderThickness="0">
                <ItemsControl.ItemTemplate>

                    <DataTemplate>
                        <RadioButton Height="25" Width="230" 
                                     Checked="RadioButton_Checked" 
                                     Unchecked="RadioButton_Checked" 
                                     Loaded="RadioButton_Loaded"
                                     VerticalContentAlignment="Center" 
                                     Style="{StaticResource RegionFeedRadioButton}"/>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>

            <!-- Spacer -->
            <Canvas Background="Transparent" Height="20"/>


        </StackPanel>


        <StackPanel Grid.Column="0" Grid.Row="1" Orientation="Vertical" 
                    HorizontalAlignment="Stretch"
                    VerticalAlignment="Bottom">
            

        

            <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="12,12,12,4">
                <Image Source="Images/nitobi-avatar-bw.png" ToolTipService.ToolTip="Built by Nitobi" Stretch="Uniform" Width="36" Height="36" Margin="4" Opacity="0.8"/>
                <Image Source="Images/AzureLogo_gs.png" ToolTipService.ToolTip="Hosted in the cloud with MS-Azure" Stretch="Uniform" Width="36" Height="36" Margin="4" Opacity="0.8"/>
            </StackPanel>

            <HyperlinkButton TargetName="_blank"
                             NavigateUri="http://data.vancouver.ca"
                             FontFamily="Segoe UI"
                             Content="Using Vancouver Open Data Catalogue" 
                             HorizontalAlignment="Center"
                             Foreground="White" Margin="4"/>

        </StackPanel>

        <!--<toolkit:GridSplitter Grid.Column="1"
              HorizontalAlignment="Center"
              VerticalAlignment="Stretch"
              Background="Black" 
              ShowsPreview="True"
              Width="5"
              />-->

        <!--<GeometryGroup>
                                <EllipseGeometry Center="38,38" RadiusX="38" RadiusY="38"></EllipseGeometry>

                            </GeometryGroup>-->



        <!--  MouseDoubleClick="Map_MouseDoubleClick"-->
        <m:Map x:Name="OpenDataMap" CopyrightVisibility="Collapsed" 
               LogoVisibility="Visible" Grid.Column="2" Grid.Row="1"
               Center="0,0" ZoomLevel="0"
               CredentialsProvider="{StaticResource MyCredentials}"  
               AnimationLevel="UserInput"
               Mode="Aerial">

            <!-- displays the region data from the service -->
            <m:MapLayer x:Name="regionsMapLayer"/>

            <!-- Points recieved from the service ( multiple layers within ) -->
            <m:MapLayer x:Name="pointsMapLayer"/>
            
            <!-- Displays community created map points -->
            <m:MapLayer x:Name="communityMapLayer" Visibility="Collapsed"/>
            
            <m:MapLayer x:Name="twitterMapLayer" Visibility="Collapsed"/>
            
            <!-- Displays layers, points added by the current user -->
            <m:MapLayer x:Name="currentUserMapLayer" Visibility="Collapsed"/>
           
            <!-- User control for commenting / rating / pinwheel, ... -->
            <m:MapLayer x:Name="userControlMapLayer" />

            <!-- Dropped, draggable pin, + Name+Description entry form. -->
            <m:MapLayer x:Name="userGenMapLayer">
                
                
            </m:MapLayer>
            
            <m:Map.Projection>
                <PlaneProjection x:Name="projRotX"  RotationX="0"></PlaneProjection>
            </m:Map.Projection>



        </m:Map>

    </Grid>
    <!--</StackPanel>-->
        
</UserControl>
